home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / utility / ffe101.zip / MOD.SWG / 0003_DCM.pas < prev    next >
Pascal/Delphi Source File  |  1996-09-04  |  5KB  |  125 lines

  1. --------M-DCM-------------------------------
  2.  
  3. The  DCM module format was designed by Winfried Welti, and is based on a
  4. RIFF  /  IFF  style format called  WUFF  - Welti's Universal File header
  5. Format.
  6.  
  7. The header for WUFF files is built much like the RIFF header :
  8.  
  9. OFFSET              Count TYPE   Description
  10. 0000h                   4 char   ID="WUFF"
  11. 0004h                   4 char   Subformat ID, see below
  12. 0008h                   1 dword  File length including the WUFF header
  13. 000Ch                   1 word   File format version as BCD.
  14.                                  Bits 15-12 are flags :
  15.                                     12 - Archive file. If set, the data after the
  16.                                          header contains only WUFF style files.
  17.                                  13-15 - reserved.
  18. 000Eh                   1 word   Length of subheader following this header.
  19.  
  20. The DCM format has a header ID of "DCMw" and a version word of 0100h. It
  21. extends the header with the following values:
  22.  
  23. 0010h                   1 word  Song flags, bitmapped
  24.                                  0 - Samples present
  25.                                  1 - Songdata present
  26.                                  2 - Infotext present
  27.                               3-15 - reserved
  28. 0012h                   1 word  Number of instruments
  29.  
  30. After  the  header,  there  follow  the  included  (WUFF) files; Allowed
  31. fileformats  for include are :  MDCw (Patterns), EDIw (Instrument), TXTw
  32. (Text); see below.
  33.  
  34. The  MDC format is a module format  which uses compiled pattern data. It
  35. has the subformat ID "MDCw", the current version is 1.01, it extends the
  36. header with the following fields :
  37.  
  38. OFFSET              Count TYPE   Description
  39. 0010h                   1 word   Flags for the song (see table 0011)
  40. 0012h                   1 word   Internal frequency for replay
  41. 0014h                   1 dword  Length of packed data channels
  42. 0028h                   1 byte   Number of used channels
  43.   24 : Chnls   : Byte      Used Channels (0..chnls-1)
  44.  
  45. (Table 0011)
  46. MDC song flags
  47.    0 - Stereo enable
  48.    1 - Free Frequency (can replay freq change in song ?)
  49.  2-3 - Offset size  :
  50.         00 - Byte (mod offsets, multiply by 256)
  51.         01 - Word  (16 bit offsets)
  52.         10 - DWord (32 bit offsets)
  53.         11 - reserved
  54.  4-5 - Panning range
  55.         00 - GUS panning (4 bit, byte value)
  56.         01 - 8 Bit panning
  57.         10 - reserved
  58.         11 - reserved
  59.  6-7 - Instrument number range
  60.         00 - Byte
  61.         01 - Word
  62.         10 - reserved
  63.         11 - reserved
  64.    8 - S3M compatibility bit (all ranges are like s3m : mod offsets,
  65.                                   GUS panning, Ins Num Range : Byte)
  66.    9 - Tuning control
  67.          0 - Use Period values (word) (s3m)
  68.          1 - Use Frequency values (Dword)
  69. 10-15- reserved
  70.  
  71. After  the  header,  there comes the  packed  data  for the module. This
  72. format  consists  of  one control byte  and  depending on the value some
  73. other data bytes.
  74.  
  75. Values of control byte :
  76.         0 - Next Frame
  77.         1 - End of File
  78.         2 - Order Num. follows [byte]
  79.         3 - Loop to Ord Num (1 byte follows)
  80.         4 - Frames to wait follows [byte]
  81.         5 - New Replay freq follows [byte]
  82.     6..31 - reserved
  83.  
  84. If the byte is greater than 31 then it has the following bitmapped format :
  85.  
  86.       0-4 - Channel Nr.
  87.         5 - Key Byte follows
  88.         6 - Period Value follows [word]
  89.         7 - Volume Value follows [byte]
  90.  
  91. Key byte format, bitmapped :
  92.  
  93.         0 - Start Sample
  94.         1 - Stop Sample
  95.         2 - Instr Nr follows [byte/word/??]
  96.         3 - Offset follows [byte/word/??]
  97.         4 - Pan pos follows [byte/??]
  98.       5-7 - reserved
  99.  
  100. The  EDI format has an ID value of "EDIw" and a version of 0100h, and it
  101. extends the header with the following information :
  102.  
  103. OFFSET              Count TYPE   Description
  104. 0010h                   1 word   Sample flags, bitmapped
  105.                                  0-1 - Loop type
  106.                                        00 - none
  107.                                        01 - forward loop
  108.                                        10 - bidirectional loop
  109.                                        11 - reserved
  110.                                    2 - 32 bit values for sample length etc., see below
  111.                                    3 - Sample is 16 bit
  112.                                    4 - Frequency is 32 bit.
  113.                                 5-15 - reserved
  114. 0012h                   1 word   C2 frequency of sample
  115. 0014h                   1 dword  Loop start, this may be a word, depending on
  116.                                  the sample flags.
  117. 0018h                   1 dword  Loop end, see loop start
  118. 001Ch                   1 dword  Sample length
  119.  
  120. The song text is plain ASCII.
  121. EXTENSION:DCM
  122. OCCURENCES:PC
  123. SEE ALSO:S3M
  124.  
  125.